package com.ctg.behavior.common.retentions;

import java.util.ArrayList;
import java.util.List;

import com.ctg.behavior.common.calc.CtCalcCommonBody;
import com.ctg.behavior.common.calc.CtCalcEvent;
import com.ctg.behavior.common.calc.CtCalcSimpleMeasure;

import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = false)
@Data
public class CtRetentionsCalcBody extends CtCalcCommonBody {

//	/*
//	 {
//		"firstEvent": {
//			"eventId": "_AppClick",
//			"filter": {
//				"conditions": [ ],
//				"relation": "or"
//			},
//			"relevanceField": ""
//		},
//		"secondEvent": {
//			"eventId": "_AppClick",
//			"filter": {
//				"conditions": [ ],
//				"relation": "or"
//			},
//			"relevanceField": ""
//		},
//		"measures": [
//			{
//				"eventId": "_AppStart",
//				"aggregator": "general"
//			}
//		],
//		"duration": 7,
//		"unit": "day",
//		"fromDate": "2021-07-19",
//		"toDate": "2021-07-24",
//		"showZeroDay": "checked",
//		"userUnit": "人",
//		"subTaskType": "RETENTION",
//		"lastZero": true,
//		"rollupDate": false,
//		"isWastage": false,
//		"byFields": [],
//		"byEvents": [],
//		"subjectId": "user_id",
//		"filter": {
//			"conditions": [ ],
//			"relation": "or"
//		},
//		"request_id": "1627110758760:885388"
//	}
//	 */
	
	// 初始行为
	private CtCalcEvent firstEvent = new CtCalcEvent();
	// 后续行为
	private CtCalcEvent secondEvent = new CtCalcEvent();
	// 同时显示: 计算事件计量规则
	private List<CtCalcSimpleMeasure> measures = new ArrayList<>();
	// 按【字段】查看 - 分组
	private List<String> byFields = new ArrayList<>();
	// 分组字段来自：初始行为-first、后续行为-second、用户属性-user
	private List<String> byEvents = new ArrayList<>();
	// 按【多少天】进行【留存/流失】计算
	private Long duration = 90L;
	// 且用户符合 ： 筛选 ===> 移动到CtCalcCommonBody类中
	// private CtCalcFilter filter = new CtCalcFilter();
	// 是否 显示第 0 日 : checked/unckecked
	private String showZeroDay = "checked";
	// 计算维度(页面显示)
	private String userUnit = "人";
	//
	private Boolean lastZero = true;
	private Boolean rollupDate = true;
	// 留存：true ; 流失：false
	private Boolean isWastage = false;
//	// 已移到CtCalcCommonBody类中
//	// 按用户维度计算
//	private String subjectId = "user_id";

}
